from django.conf.urls.defaults import *

urlpatterns = patterns('django_documents.views',
    url(r'^$', 'list_documents', name="documents-list"),
    url(r'^filter/(?P<cat_id>\d+)/$', 'list_documents', name="documents-list-cat"),
    url(r'^new/$', 'new_document', name="documents-new"),
    url(r'^details/(?P<doc_id>\d+)/$', 'document_details', name="documents-details"),
    url(r'^edit/(?P<doc_id>\d+)/$', 'change_document', name="documents-change"),
    url(r'^delete/(?P<doc_id>\d+)/$', 'delete_document', name="documents-delete"),
    url(r'^new/version/(?P<doc_id>\d+)/$', 'new_version', name="documents-new-version"),
    url(r'^doc/(?P<filename>[^/]+)/$', 'serve_document', name="documents-file"),
    url(r'^doc/(?P<filename>[^/]+)/(?P<version>[^/]+)/$', 'serve_document', name="documents-file-version"),
    url(r'^category/new/$', 'new_category', name="documents-new-category"),
)
